﻿#ifndef __SS_OPENGL_CONSOLE_H__
#define __SS_OPENGL_CONSOLE_H__
#include "../ss3dDefine.h"
#include "ssGLCheck.h"
#include "ssOpenGLDevice.h"
#include "ssSingleton.h"


namespace StarSeeker
{

class ssOpenGLSupport
{
public:
	ssOpenGLSupport();
	~ssOpenGLSupport();

	bool InitGLDevice(HWND hwnd, HDISPLAY hdis, int width, int height);
	void InitGLState(bool isWireFrame=false);
	void BeginRender();
	void EndRender();
	void SetCullMode(int m);
	void SwapBuffers()
	{
		if (m_glDevice)
		{
			m_glDevice->SwapBuffers();
		}
	}

	ssGLDevice*			m_glDevice;
	int					m_nWidth;
	int					m_nHeight;
	ssOpenglCheck		m_check;
};
#define SS_OPENGL	StarSeeker::ssSingle<StarSeeker::ssOpenGLSupport>::instance()

//错误信息
int CheckGlError(const char* op=0);

}
#endif
